Altera uma regra e, conforme `apply_to`, as contas que ela já gerou.
curl --request PATCH \
--url https://economy.synxbr.com/api/v1/recurrences/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"amount": "<string>",
"days_of_period": [
123
],
"end_date": "2023-12-25",
"max_occurrences": 60,
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"has_fiscal_note": true,
"document": {
"number": "<string>"
},
"from_occurrence": 2
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
amount: '<string>',
days_of_period: [123],
end_date: '2023-12-25',
max_occurrences: 60,
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer: {name: '<string>', tax_id: '<string>', email: '<string>', phone: '<string>'},
branch_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
bank_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
subcategory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
notes: '<string>',
has_fiscal_note: true,
document: {number: '<string>'},
from_occurrence: 2
})
};
fetch('https://economy.synxbr.com/api/v1/recurrences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/recurrences/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"amount": "<string>",
"days_of_period": [123],
"end_date": "2023-12-25",
"max_occurrences": 60,
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"has_fiscal_note": True,
"document": { "number": "<string>" },
"from_occurrence": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/recurrences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'amount' => '<string>',
'days_of_period' => [
123
],
'end_date' => '2023-12-25',
'max_occurrences' => 60,
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer' => [
'name' => '<string>',
'tax_id' => '<string>',
'email' => '<string>',
'phone' => '<string>'
],
'branch_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'bank_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'subcategory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'notes' => '<string>',
'has_fiscal_note' => true,
'document' => [
'number' => '<string>'
],
'from_occurrence' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "payable",
"name": "<string>",
"description": "<string>",
"status": "active",
"frequency": "weekly",
"days_of_period": [
123
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"termination": "date",
"max_occurrences": 123,
"amount": "<string>",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"cost_center": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"document": {
"number": "<string>",
"type": "bank_slip",
"has_fiscal_note": true
},
"notes": "<string>",
"payment_method": "pix",
"splits": [
{
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"employee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"amount": "1234.56"
}
],
"next_date": "2023-12-25",
"last_generated_date": "2023-12-25",
"generated_count": 123,
"paused_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Altera uma regra e, conforme `apply_to`, as contas que ela já gerou.
Só os campos enviados mudam. apply_to diz o alcance nas contas já geradas — sempre só as intocadas (sem baixa nenhuma e fora de envio ao banco): rule (padrão) só a regra; future as em aberto que vencem de hoje em diante recebem o que mudou (valor, descrição, classificação, fornecedor ou cliente, filial, conta), sem mudar datas; from_occurrence idem a partir da conta número from_occurrence; all_open as em aberto são excluídas e o calendário é refeito pela regra nova. Frequência, dias e término mudam as datas: só com rule ou all_open.
Permissão exigida: Gerenciar recorrências (recurrence.manage).
PATCH
/
recurrences
/
{id}
Altera uma regra e, conforme `apply_to`, as contas que ela já gerou.
curl --request PATCH \
--url https://economy.synxbr.com/api/v1/recurrences/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"amount": "<string>",
"days_of_period": [
123
],
"end_date": "2023-12-25",
"max_occurrences": 60,
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"has_fiscal_note": true,
"document": {
"number": "<string>"
},
"from_occurrence": 2
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
amount: '<string>',
days_of_period: [123],
end_date: '2023-12-25',
max_occurrences: 60,
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer: {name: '<string>', tax_id: '<string>', email: '<string>', phone: '<string>'},
branch_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
bank_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
subcategory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
notes: '<string>',
has_fiscal_note: true,
document: {number: '<string>'},
from_occurrence: 2
})
};
fetch('https://economy.synxbr.com/api/v1/recurrences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/recurrences/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"amount": "<string>",
"days_of_period": [123],
"end_date": "2023-12-25",
"max_occurrences": 60,
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"has_fiscal_note": True,
"document": { "number": "<string>" },
"from_occurrence": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/recurrences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'amount' => '<string>',
'days_of_period' => [
123
],
'end_date' => '2023-12-25',
'max_occurrences' => 60,
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer' => [
'name' => '<string>',
'tax_id' => '<string>',
'email' => '<string>',
'phone' => '<string>'
],
'branch_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'bank_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'subcategory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'notes' => '<string>',
'has_fiscal_note' => true,
'document' => [
'number' => '<string>'
],
'from_occurrence' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "payable",
"name": "<string>",
"description": "<string>",
"status": "active",
"frequency": "weekly",
"days_of_period": [
123
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"termination": "date",
"max_occurrences": 123,
"amount": "<string>",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"cost_center": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"document": {
"number": "<string>",
"type": "bank_slip",
"has_fiscal_note": true
},
"notes": "<string>",
"payment_method": "pix",
"splits": [
{
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"employee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"amount": "1234.56"
}
],
"next_date": "2023-12-25",
"last_generated_date": "2023-12-25",
"generated_count": 123,
"paused_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Autorizações
Corpo
application/json